Fix vmalloc fault path in arch/xen/i386 to correctly deal
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 6 Sep 2005 09:44:58 +0000 (09:44 +0000)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Tue, 6 Sep 2005 09:44:58 +0000 (09:44 +0000)
with _PAGE_PRESENT being missing from init_mm's pmd
entry (*pmd_k).

Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
linux-2.6-xen-sparse/arch/xen/i386/mm/fault.c

index 431448df30dbb75262b941e4c0da96042d112690..088b7e0e36227132afe35859d2ca1a7d46e08637 100644 (file)
@@ -588,7 +588,15 @@ vmalloc_fault:
                pmd_k = pmd_offset(pud_k, address);
                if (!pmd_present(*pmd_k))
                        goto no_context;
+#ifndef CONFIG_XEN
                set_pmd(pmd, *pmd_k);
+#else
+               /*
+                * When running on Xen we must launder *pmd_k through
+                * pmd_val() to ensure that _PAGE_PRESENT is correctly set.
+                */
+               set_pmd(pmd, __pmd(pmd_val(*pmd_k)));
+#endif
 
                pte_k = pte_offset_kernel(pmd_k, address);
                if (!pte_present(*pte_k))